package com.gem.growingtree.activity;

import javax.security.auth.PrivateCredentialPermission;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class EditIndividualitySignature extends Activity {

	private TextView signatureback;
	private Button savesignature;
	private EditText editsignature;
	private TextView oldsignature;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_edit_individuality_signature);
		
		signatureback = (TextView) findViewById(R.id.signatureback);
		savesignature = (Button) findViewById(R.id.save_signature);
		editsignature = (EditText) findViewById(R.id.new_signature);
		oldsignature = (TextView) findViewById(R.id.individuality_signature);
		String oldSig = oldsignature.getText().toString();
		editsignature.setText(oldSig);
		
		signatureback.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(EditIndividualitySignature.this, MyInformationActivity.class);
				startActivity(intent);
			}
		});
						
	}

	public void saveSignature(View view) {
		String newsignatureString = editsignature.getText().toString();
		TextView signature = (TextView) findViewById(R.id.individuality_signature);
		signature.setText(newsignatureString);
		Intent intent = new Intent();
		intent.setClass(EditIndividualitySignature.this, MyInformationActivity.class);
		startActivity(intent);
	}
	
}
